<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button class="cn">切换至中文</button>
    <button class="en">切换至英文</button>
</body>
<script type="module">//如果用import导入的话，需要加type='module'
    import { get, set, remove } from './16.cookie.js';
    const cn = document.querySelector('.cn')
    const en = document.querySelector('.en')
    cn.addEventListener('click', function () {
        set('language', 'cn', {
            maxAge: 60 * 24 * 30
        })
        window.location = './17.网站语言切换.html'
    })
    en.addEventListener('click', function () {
        set('language', 'en', {
            maxAge: 60 * 24 * 30
        })
        window.location = './17.网站语言切换.html'
    })
</script>

</html>